package exsun.jt808.data.media.operate.util;

public class Int2ByteArray {
    public static byte[] int2Byte4(int i) {
        byte[] buffer4Byte=new byte[4];
        buffer4Byte[0] = (byte)( i >> 24);
        buffer4Byte[1] = (byte)((i >> 16) & 0xff);
        buffer4Byte[2] = (byte)((i >> 8) & 0xff);
        buffer4Byte[3] = (byte)(i & 0xff);
        return buffer4Byte;
    }
    public static byte[] int2Byte3(int i) {
        byte[] buffer3Byte=new byte[3];
        buffer3Byte[0] = (byte)((i >> 16) & 0xff);
        buffer3Byte[1] = (byte)((i >> 8) & 0xff);
        buffer3Byte[2] = (byte)(i & 0xff);
        return buffer3Byte;
    }
    public static byte[] int2Byte2(int i) {
        byte[] buffer2Byte=new byte[2];
        buffer2Byte[0] = (byte)((i >> 8) & 0xff);
        buffer2Byte[1] = (byte)(i & 0xff);
        return buffer2Byte;
    }
}
